### Instructions

{% if lang_config['name'] == 'JavaScript' and lang_config['sdk_ver'] == 3 %}
**Note**: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
[JavaScript ES6/CommonJS syntax](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html).

**Run a single action**

```bash
node ./actions/<fileName>
```

**Run a scenario**
Most scenarios can be run with the following command:
```bash
node ./scenarios/<fileName>
```
{% endif %}
{% if lang_config['name'] == '.NET' and lang_config['sdk_ver'] == 3 %}
For general instructions to run the examples, see the
[README](../README.md#building-and-running-the-code-examples) in the `dotnetv3` folder.

Some projects might include a settings.json file. Before compiling the project,
you can change these values to match your own account and resources. Alternatively,
add a settings.local.json file with your local settings, which will be loaded automatically
when the application runs.

After the example compiles, you can run it from the command line. To do so, navigate to
the folder that contains the .csproj file and run the following command:

```
dotnet run
```

Alternatively, you can run the example from within your IDE.

{% endif %}
{% if lang_config['name'] == 'C++' %}
An executable is built for each source file in this folder. These executables are located in the build folder and have
"run_" prepended to the source file name, minus the suffix. See the "main" function in the source file for further instructions.

For example, to run the action in the source file "my_action.cpp", execute the following command from within the build folder. The command
will display any required arguments.

```
./run_my_action
```

If the source file is in a different folder, instructions can be found in the README in that
folder.
{% endif %}
{% if lang_config['name'] == 'Swift' %}
To build any of these examples from a terminal window, navigate into its
directory, then use the following command:

```
$ swift build
```

To build one of these examples in Xcode, navigate to the example's directory
(such as the `ListUsers` directory, to build that example). Then type `xed.`
to open the example directory in Xcode. You can then use standard Xcode build
and run commands.
{% endif %}

<!--custom.instructions.start-->
{{ customs['instructions'] -}}
<!--custom.instructions.end-->

{% for hello_ex in hello %}
#### {{ hello_ex['title_abbrev'] }}

This example shows you how to {{ hello_ex['synopsis'] }}

{% if lang_config['name'] == 'Go' and lang_config['sdk_ver'] == 2 %}
```
go run ./hello
```
{% endif %}
{% if lang_config['name'] == 'Python' and lang_config['sdk_ver'] == 3 %}
```
python hello.py
```
{% endif %}
{% if lang_config['name'] == 'JavaScript' and lang_config['sdk_ver'] == 3 %}
```bash
node ./hello.js
```
{% endif %}
{% endfor %}

{% if lang_config['name'] == 'Go' and lang_config['sdk_ver'] == 2 %}
#### Run a scenario

All scenarios can be run with the `cmd` runner. To get a list of scenarios
and to get help for running a scenario, use the following command:

```
go run ./cmd -h
```
{% endif %}

{% for scenario in scenarios %}
#### {{scenario['title_abbrev']}}

{% if scenario['synopsis'] %}
This example shows you how to {{scenario['synopsis']}}

{% else %}
This example shows you how to do the following:

{% endif %}
{% for syn in scenario['synopsis_list'] %}
- {{syn}}
{% endfor %}

<!--custom.scenario_prereqs.{{ scenario['id'] }}.start-->
{% if customs['scenario_prereqs'] %}{{ customs['scenario_prereqs'][scenario['id']] -}}{% endif %}
<!--custom.scenario_prereqs.{{ scenario['id'] }}.end-->

{% if lang_config['name'] == 'Python' and lang_config['sdk_ver'] == 3 and scenario["file"].endswith(".py") %}
Start the example by running the following at a command prompt:

```
python {{scenario['file']}}
```

{% elif lang_config['name'] == 'Ruby' and lang_config['sdk_ver'] == 3 %}
Start the example by running the following at a command prompt:

```
ruby {{scenario['file']}}
```
{% endif %}

<!--custom.scenarios.{{ scenario['id'] }}.start-->
{% if customs['scenarios'] %}{{ customs['scenarios'][scenario['id']] -}}{% endif %}
<!--custom.scenarios.{{ scenario['id'] }}.end-->

{% endfor %}